<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Stellasketch: Browse</title>
<link rel="stylesheet" href="css/style.css" TYPE="text/css">

</head>

<body>
<jsp:include page="nav.jsp" />
<jsp:include page="showError.jsp" />

<c:choose>
	<c:when test="${!empty sketch}">

		<table>
			<tr>
				<td><a class="toggleborder" href="sketch/${sketch.id}.pdf"><img
					src="sketch/${sketch.id}.png" width="400" height="400" /></a></td>
				<td>
				<table>
					<tr>
						<td>Sketch:</td>
						<td><a href="./?a=browse&sketchID=${sketch.id}">#${sketch.id}</a></td>
					</tr>
					<tr>
						<td>Game:</td>
						<td><a href="./?a=browse&gameID=${sketch.round.game.id}">#${sketch.round.game.id}</a></td>
					</tr>
					<tr>
						<td>Theme:</td>
						<td><a
							href="./?a=browse&themeID=${sketch.round.game.theme.id}">${sketch.round.game.theme.name}</a></td>
					</tr>
					<tr>
						<td>Clue:</td>
						<td><a href="./?a=browse&clueID=${sketch.round.clue.id}">${sketch.round.clue.name}</a></td>
					</tr>
					<tr>
						<td>Artist:</td>
						<td><a
							href="./?a=browse&personID=${sketch.round.sketcher.id}">${sketch.round.sketcher.nick}</a></td>
					</tr>
					<tr><td></td><td><br /><br /></td></tr>
					<tr valign="top">
						<td>Labels:</td>
						<td align="left">
							<c:forEach items="${sketch.labels}" var="label">
								${label.text}<br />
							</c:forEach>
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
	</c:when>
	<c:when test="${!empty sketches}">
		<p>${reason}</p>
		<c:if test="${! empty link}">
			<a href="${link}">${linkText}</a>
		</c:if>
		<br />
		<br />
		<c:forEach items="${sketches}" var="s">
			<a class="toggleborder" href="./?a=browse&sketchID=${s.id}"><img
				src="sketch/${s.id}-100.png" width="100" height="100"
				title="${s.round.clue.name}" /></a>
		</c:forEach>
		<br />
		<br />
		<c:if test="${!empty pagePrev}">
			<a href="./?a=browse&pageSize=${pageSize}&pageNum=${pagePrev}">(Previous Page)</a>
		</c:if>
		<c:if test="${!empty pageNext}">
			<a href="./?a=browse&pageSize=${pageSize}&pageNum=${pageNext}">(Next Page)</a>
		</c:if>
	</c:when>
	<c:otherwise>
		I didn't error out, yet I don't have any data to present you. Sad face.
	</c:otherwise>
</c:choose>

</body>
</html>
